#include "syscall.h"
#include "print.c"



void main(){

	int lock=-1;
	int lock1=-1;
	int cv=-1;

	lock = CreateLock("LOCK",4);
	lock1 = CreateLock("LOCK1",5);
	cv = CreateCondition("CV",2);

	printString("=======Use lock without acquire=========\n");

	Release(lock);
	Wait(cv,lock);
	Signal(cv,lock);
	Broadcast(cv,lock);

	printString("=======Signal a cv with no thread is waiting.======\n");
	
	Acquire(lock);
	Signal(cv,lock);
	Release(lock);
	
	DestroyLock(lock);
	DestroyLock(lock1);
	DestroyCondition(cv);

	StopServer();
	Exit(0);
}
